*Appendix Figure 1

cd "/Users/kevin/Dropbox/TZ ITNs"
set more off
set varabbrev off

use "constructed data/for_analysis.dta", clear

cd "/Users/kevin/Dropbox/TZ ITNs/plots"


 forvalues i=60(30)180 {
reg approve_vc1 post post_trend time_since_ucc  if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}


coefplot (period_60, label("60 days")) (period_90, label("90 days")) (period_120, label("120 days")) ///
(period_150, label("150 days")) (period_180, label("180 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("VC approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "60" .834 "90" 1 "120" 1.166 "150" 1.332 "180") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_vc_trend_bw.gph", replace
  
    forvalues i=60(30)180 {
reg approve_veo1 post post_trend time_since_ucc  if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_60, label("60 days")) (period_90, label("90 days")) (period_120, label("120 days")) ///
(period_150, label("150 days")) (period_180, label("180 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("VEO approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "60" .834 "90" 1 "120" 1.166 "150" 1.332 "180") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_veo_trend_bw.gph", replace
  
      forvalues i=60(30)180 {
reg approve_councillor1 post post_trend time_since_ucc  if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_60, label("60 days")) (period_90, label("90 days")) (period_120, label("120 days")) ///
(period_150, label("150 days")) (period_180, label("180 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("Councillor approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "60" .834 "90" 1 "120" 1.166 "150" 1.332 "180") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_councillor_trend_bw.gph", replace
  
       forvalues i=60(30)180 {
reg approve_weo1 post post_trend time_since_ucc  if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_60, label("60 days")) (period_90, label("90 days")) (period_120, label("120 days")) ///
(period_150, label("150 days")) (period_180, label("180 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("WEO approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "60" .834 "90" 1 "120" 1.166 "150" 1.332 "180") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_weo_trend_bw.gph", replace

        forvalues i=60(30)180 {
reg approve_mp1 post post_trend time_since_ucc  if period_`i'==1 & omitperiod==0, r cluster(dist_id)
estimates store period_`i'
}

coefplot (period_60, label("60 days")) (period_90, label("90 days")) (period_120, label("120 days")) ///
(period_150, label("150 days")) (period_180, label("180 days")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("MP approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "60" .834 "90" 1 "120" 1.166 "150" 1.332 "180") legend(off) xtitle("Number of days", size(medlarge))
graph save Graph "binary_mp_trend_bw.gph", replace

graph combine "binary_vc_trend_bw.gph" "binary_veo_trend_bw.gph" "binary_councillor_trend_bw.gph" "binary_weo_trend_bw.gph" ///
"binary_mp_trend_bw.gph", ///
rows(2) cols(3) subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))      

